/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.rec.be;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Programador
 */
@Entity
@Table(name = "REC_NOTIFICACION")
@NamedQueries({@NamedQuery(name = "Notificacion.findAll", query = "SELECT n FROM Notificacion n"), @NamedQuery(name = "Notificacion.findByIdNotificacion", query = "SELECT n FROM Notificacion n WHERE n.idNotificacion = :idNotificacion"), @NamedQuery(name = "Notificacion.findByAnotacion", query = "SELECT n FROM Notificacion n WHERE n.anotacion = :anotacion"), @NamedQuery(name = "Notificacion.findByAnalista", query = "SELECT n FROM Notificacion n WHERE n.analista = :analista"), @NamedQuery(name = "Notificacion.findByFechaRegistro", query = "SELECT n FROM Notificacion n WHERE n.fechaRegistro = :fechaRegistro")})
public class Notificacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_NOTIFICACION", nullable = false)
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    private Long idNotificacion;
    @Column(name = "ANOTACION", length = 50)
    private String anotacion;
    @Column(name = "ANALISTA", length = 50)
    private String analista;
    @Column(name = "FECHA_REGISTRO")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaRegistro;
    @JoinColumns({@JoinColumn(name = "FID_REC_CARTERA", referencedColumnName = "ID_CARTERA"), @JoinColumn(name = "FID_REC_CREDITO", referencedColumnName = "ID_CREDITO")})
    @ManyToOne(fetch = FetchType.LAZY)
    private CreditoCartera creditoCartera;

    public Notificacion() {
    }

    public Notificacion(Long idNotificacion) {
        this.idNotificacion = idNotificacion;
    }

    public Long getIdNotificacion() {
        return idNotificacion;
    }

    public void setIdNotificacion(Long idNotificacion) {
        this.idNotificacion = idNotificacion;
    }

    public String getAnotacion() {
        return anotacion;
    }

    public void setAnotacion(String anotacion) {
        this.anotacion = anotacion;
    }

    public String getAnalista() {
        return analista;
    }

    public void setAnalista(String analista) {
        this.analista = analista;
    }

    public Date getFechaRegistro() {
        return fechaRegistro;
    }

    public void setFechaRegistro(Date fechaRegistro) {
        this.fechaRegistro = fechaRegistro;
    }

    public CreditoCartera getCreditoCartera() {
        return creditoCartera;
    }

    public void setCreditoCartera(CreditoCartera creditoCartera) {
        this.creditoCartera = creditoCartera;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idNotificacion != null ? idNotificacion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Notificacion)) {
            return false;
        }
        Notificacion other = (Notificacion) object;
        if ((this.idNotificacion == null && other.idNotificacion != null) || (this.idNotificacion != null && !this.idNotificacion.equals(other.idNotificacion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.rec.be.Notificacion[idNotificacion=" + idNotificacion + "]";
    }

}
